﻿using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NamingPipe.Client
{
    class Program
    {
        static void Main(string[] args)
        {
            using(NamedPipeClientStream clientStream = new NamedPipeClientStream(".","Test", PipeDirection.InOut))
            {
                clientStream.Connect();
                clientStream.ReadMode = PipeTransmissionMode.Byte;
                using(StreamWriter writer = new StreamWriter(clientStream))
                {
                    writer.Write("Hello server, my name is wangyucai!");
                }
            }
        }
    }
}
